#ifndef COMMON_H
#define COMMON_H

#include <stdio.h>

#define debug( ... ); {fprintf(stderr,"%s: %d: ",__FILE__, __LINE__); fprintf(stderr , __VA_ARGS__ ); fprintf(stderr,"\n");}
#define norm_drot
//#define printf( ... ); pouzi_debug_supak
#define FOR(a,b) for (int a=0;a<b;a++)
#define maxx(a,b) (a)<(b)?(a):(b)
#define minn(a,b) (a)<(b)?(b):(a)
#define square(a) ((a)*(a))

/*void debug_func (const char *,int,const char *){
	fprintf(stderr,"%s: %d: %s\n",_file,_line,_debug);
}*/
class point {
	public:
		float x,y,z;
		float & operator [] (int index);
		point operator + (point second);
		point operator - (point second);
		point operator * (float second);
		point operator / (float second);
};

class UVCord {
	public:
		float u,v;
		float & operator [] (int index);
};

class face {
	public:
		int a,b,c,UV_a,UV_b,UV_c;
		int & operator [] (int index);
		
//		void set (int _a, int _b, int _c){a=_a;b=_b;c=_c;triangle=1;}
};

class rail {
	public:
		float x,y,rot;
		char type;	//0 left 1 straight 2 right
		rail* next;
		unsigned int index;
};

#endif
